package com.itheima.controller;

import com.itheima.common.dto.MessageDTO;
import com.itheima.common.entity.Result;
import com.itheima.service.MemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
@Slf4j
public class MemberController {
    @Autowired
    private MemberService memberService;

    /**
     * 手机验证码登录
     * @param messageDTO
     * @return
     */
    @PostMapping("/login")
    public Result memberLogin(@RequestBody MessageDTO messageDTO) {
        log.info("手机验证码登录，参数：{}", messageDTO);
        memberService.memberLogin(messageDTO);
        return Result.success();
    }
}
